Skip to content

Delay displaying discovered devices until DNS-SD discovery completes - #455

Draft
SinghCod3r wants to merge 1 commit into
OpenPrinting:masterfrom
SinghCod3r:fix-ipp-usb-discovery-flicker
Draft

Delay displaying discovered devices until DNS-SD discovery completes#455
SinghCod3r wants to merge 1 commit into
OpenPrinting:masterfrom
SinghCod3r:fix-ipp-usb-discovery-flicker

Conversation

@SinghCod3r

Copy link
Copy Markdown

Problem

When a printer supports IPP-over-USB, device discovery currently happens in
multiple stages:

  1. Local USB devices are displayed immediately.
  2. Network discovery runs.
  3. DNS-SD resolution discovers the IPP-over-USB device.

As a result, the legacy USB device briefly appears in the list before being
suppressed in favor of the IPP-over-USB device, causing a noticeable UI
flicker.

Solution

Buffer discovered devices until discovery has completed.

Instead of updating the UI after each discovery phase, this change collects
local devices, network devices, and resolved DNS-SD devices before calling
add_devices().

This allows duplicate suppression to operate on the complete device set before
anything is inserted into the TreeView, eliminating the temporary USB entry.

Additional changes

  • Improve USB serial extraction by parsing the URI query string correctly.
  • Populate missing serial numbers from the DNS-SD usb_SER TXT record.
  • Reuse the same duplicate suppression logic in the D-Bus service.
  • Add regression tests covering serial parsing and duplicate suppression.

Testing

Tested manually with an IPP-over-USB printer.

Buffer discovered devices until DNS-SD resolution finishes so the UI is
updated only once. This avoids the brief appearance and removal of legacy
USB printers when an IPP-over-USB device is discovered.

Signed-off-by: SinghCod3r <ayushsinghceee@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant